/**
 * @param {arr} x
 * @return {targe}
 */

var twoSum = function(nums, target) {
    var map = {};
  var len = nums.length;
  for(let i=0; i<len;i++){
      if(map[target-nums[i]]>=0){
          console.log(map[target-nums[i]],i)
          return [map[target-nums[i]],i];
      }
      map[nums[i]] = i; 
 }
};
twoSum([1,3,3,4],6)